#ifndef TOUCH_INTERRUPT_H_
#define TOUCH_INTERRUPT_H_

 // Includes
	#include <string.h>
	#include <stdio.h>
	#include <ctype.h>
	#include <stdlib.h>

	#include <avr/io.h>
	#include <avr/wdt.h>
	#include <avr/power.h>
	#include <avr/interrupt.h>
	#include <avr/eeprom.h>
	#include <avr/pgmspace.h>

	#include <LUFA/Version.h>
	#include <LUFA/Drivers/USB/USB.h>
	#include <process_USB.h>
//	#include <scpi.h>
	#include <Loadbox_scpi.h>
	#include "USB_Load_Box_Board.h"

#define					YES						1
#define					NO						0
/****************************************************************************
*				Timing	Constants											*
*****************************************************************************/
#define					LEAKAGE_TIME			400			// 100ms
#define					LONG_SWIPE_TIMEOUT		256			// 65ms
#define					MAX_IDLE_TIME			256			// 65ms
#define					FAST_TIME				512			// 131ms
#define					INTERMEDIATE_TIME		1024		// 262ms
#define					SLOW_TIME				1536		// 393ms
#define					VERY_SLOW_TIME			4096		// 1024ms
/****************************************************************************
*				Raw Sensor Pads												*
*****************************************************************************/
#define					NONE					0
#define					NOSENSOR				0
#define					RED						1
#define					BLUE					2
#define					GREEN					3
#define					YELLOW					4
/****************************************************************************
*				Gesture Types												*
*****************************************************************************/
#define					SWIPE					5
#define					TOUCH					6
#define					DOUBLE_PAD				7
/****************************************************************************
*				Gesture Senses												*
*****************************************************************************/
#define					RIGHT					8
#define					LEFT					9
/****************************************************************************
*				Gesture Sizes												*
*****************************************************************************/
#define					LARGE					10
#define					MEDIUM					11
#define					SMALL					12
/****************************************************************************
*				Gesture Durations											*
*****************************************************************************/
#define					FAST					13
#define					INTERMEDIATE			14
#define					SLOW					15
#define					VERY_SLOW				16

#define					DOWN					0
#define					UP						1

uint16_t	Get_Sensor_Time(volatile uint8_t *the_port, volatile uint8_t *the_ddr, uint8_t the_sensor, volatile uint8_t *the_pin);
void		process_gesture(IO_pointers_t IO);
void		update_LCD(IO_pointers_t IO);

#endif